> ASP Path 属性

ASP Path 属性

定义和用法

Path 属性用于返回指定驱动器、文件或文件夹的路径。

注释:对于驱动器,路径不包含根目录。例如,C 驱动器的路径是 C:,而不是 C:。

语法:


DriveObject.Path 
FileObject.Path
FolderObject.Path

针对 Drive 对象的例子


<%
dim fs,d
set fs=Server.CreateObject("Scripting.FileSystemObject")
set d=fs.GetDrive("c:")
Response.Write("The path is " & d.Path)
set d=nothing
set fs=nothing
%>

输出:

The path is C:

针对 File 对象的例子


<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.GetFile("c:asp	est	est")
Response.Write("The path is: " & f.Path)
set f=nothing
set fs=nothing
%>

输出:

The path is: C:asp	est	est

针对 Folder 对象的例子


<%
dim fs,fo
set fs=Server.CreateObject("Scripting.FileSystemObject")
set fo=fs.GetFolder("c:asp	est")
Response.Write("The path is: " & fo.Path)
set fo=nothing
set fs=nothing
%>

输出:

The path is: C:asp	est
参考手册

W3c0.com 提供的内容仅用于培训。我们不保证内容的正确性。通过使用本站内容随之而来的风险与本站无关。W3c0 简体中文版的所有内容仅供测试,对任何法律问题及风险不承担任何责任。 当使用本站时,代表您已接受了本站的使用条款和隐私条款。版权所有,保留一切权利。 鲁ICP备15022115号